<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../plantillas/base.xhtml">
    <ui:param name="titulo" value="AgileFalcon"/>
    <ui:define name="content">
        <f:view>
            <h:form id="login_form">
                <p:messages id="messages"  autoUpdate="true"/>  
                <p:fieldset legend="Table Selection">  
                    <h:panelGrid columns="2" cellpadding="10">
                        <p:fieldset  style="margin: 5px 0 0 5px; height: 400px;">                          
                            <p:panelGrid columns="3">
                                <h:outputLabel value="From Table" style="font-size: 22px;"/>
                                <p:selectOneMenu value="#{beanConexionDB.sourceTable}" id="sourceTablesList">                                                                        
                                    <f:selectItems value="#{beanConexionDB.sourceTablesList}"
                                                   id="sourceTablesList2"/>                         
                                </p:selectOneMenu>                                
                                <p:commandButton id="cb_cargar_from_columns" icon="ui-icon-search" ajax="false" action="#{beanConexionDB.cargarSourceColumns}"/>
                            </p:panelGrid>
                            <BR/>
                            <p:dataTable id="tablaidsourceTable"                            
                                         var="tabla1sourceTable"
                                         value="#{beanConexionDB.sourceColumnsList}" 
                                         >
                                <f:facet name="header" >
                                    Source Columns List
                                </f:facet>

                                <p:column headerText="Index" >
                                    <h:outputText value="#{tabla1sourceTable.index}"/>
                                </p:column>
                                <p:column headerText="Name" >
                                    <h:outputText value="#{tabla1sourceTable.field}"/>
                                </p:column>
                                <p:column headerText="Data Type" >
                                    <h:outputText value="#{tabla1sourceTable.dataType}"/>
                                </p:column>
                                <p:column headerText="Null" >
                                    <h:outputText value="#{tabla1sourceTable.white}"/>
                                </p:column>
                            </p:dataTable>


                        </p:fieldset>
                        <p:fieldset  style="margin: 5px 0 0 5px; height: 400px;">                          
                            <p:panelGrid columns="3">
                                <h:outputLabel value="To Table" style="font-size: 22px;font: bold"/>
                                <p:selectOneMenu value="#{beanConexionDB.destinyTable}">                                                                        
                                    <f:selectItems value="#{beanConexionDB.destinyTablesList}"/>                                    
                                </p:selectOneMenu>
                                <p:commandButton id="cb_cargar_from_columns2" icon="ui-icon-search" ajax="false" action="#{beanConexionDB.cargarDestinyColumns}"/>
                            </p:panelGrid>
                            <BR/>
                            <p:dataTable id="iddestinyTable"                            
                                         var="destinyTable"
                                         value="#{beanConexionDB.destinyColumnsList}" >
                                <f:facet name="header" >
                                    Destiny Columns List
                                </f:facet>

                                <p:column headerText="Name" >
                                    <h:outputText value="#{destinyTable.field}"/>
                                </p:column>
                                <p:column headerText="Data Type" >
                                    <h:outputText value="#{destinyTable.dataType}"/>
                                </p:column>
                                <p:column headerText="Null" >
                                    <h:outputText value="#{destinyTable.white}"/>
                                </p:column>
                                <p:column headerText="Index">
                                    <h:inputText value="#{destinyTable.indexMigrar}" style="width: 25px;"/>
                                </p:column>
                            </p:dataTable>
                        </p:fieldset>
                    </h:panelGrid>
                    <h:panelGrid columns="2">
                        <p:commandButton value="Cancel" style="width: 100px" 
                                         action="#{beanConexionDB.home}" ajax="false"/>
                        <p:commandButton value="Next" style="width: 125px" action="#{beanConexionDB.migrar}"/>
                    </h:panelGrid>
                </p:fieldset>
            </h:form>
        </f:view>
    </ui:define>
</ui:composition>